/* 金钱千分位 */
export function formatMoney(value: string | number): string {
  value = Number(value).toFixed(2);
  if (/[^0-9.\-]/.test(value)) return "0";
  if (value == null || value == "") return "0";
  value = value.toString().replace(/^(-)?(\d*)$/, "$1$2.");
  value = (value + "00").replace(/(-)?(\d*\.\d\d)\d*/, "$1$2");
  value = value.replace(".", ",");
  const re = /(\d)(\d{3},)/;
  while (re.test(value)) value = value.replace(re, "$1,$2");
  value = value.replace(/,(\d\d)$/, ".$1");
  return value;
}
// type FileType = "Excel" | "zip" | "PDF" | "Word";
/* 客户类型过滤 */
export function customerTypeFilter(value: string): string {
  switch (value) {
    case "1":
      return "一般纳税人";
    case "2":
      return "小规模";
    case "3":
      return "个体工商户";
    case "4":
      return "其它";
    default:
      return "";
  }
}

/* 业务类型 */
export function businessTypeFilter(value: number): string {
  return value === 1 ? "财务报表审计" : value === 2 ? "非财务报表审计" : "";
}

/* 归档状态 */
export function archivingStatusFilter(value: number): string {
  return value === 1
    ? "项目实施"
    : value === 2
      ? "报告出具，未归档"
      : value === 3
        ? "已归档"
        : "";
}
